
import Vue from 'vue'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import App from './App.vue'

import VueRouter from "vue-router"
//开启debug模式
Vue.config.debug = true;
Vue.use(VueRouter);
import shouye from './components/home.vue'
import index_main from './components/index_main.vue'
import index_swipe from './components/index_swipe.vue'
import functionOne from './components/functionOne.vue'
import functionTwo from './components/functionTwo.vue'
import functionthree from './components/functionthree.vue'
import functionfour from './components/functionfour.vue'
import functionfourchoose from './components/functionfourchoose.vue'
import chaxun from './components/chaxun.vue'
import comment from './components/comment.vue'
import functionOnechoose from './components/functionOnechoose.vue'
import functionTwochoose from './components/functionTwochoose.vue'
import shangchuan from './components/shangchuan.vue'
import commentone from './components/commentone.vue'
Vue.use(MintUI)

import store from './vuex/store'

// 创建一个路由器实例并且配置路由规则
const router = new VueRouter({
  mode: 'history',
  base: __dirname,
  routes: [

      {
          path : '/',
          component :shouye ,
          children : [
              {
                  path : '',
                  components : {

                      index_main,
                      index_swipe
                  }
              }
          ]
      },{
          path : '/functionOne',
          component: functionOne

      },
      {
          path : '/functionTwo',
          component: functionTwo

      },
      {
          path : '/functionfour',
          component: functionfour

      },
      {
          path : '/functionfourchoose',
          component: functionfourchoose

      },
      {
          path:'/chaxun',
          component:chaxun
      },
      {
          path:'/comment',
          component:comment
      },{
          path : '/functionOnechoose',
          component: functionOnechoose

      },{
          path : '/functionTwochoose',
          component: functionTwochoose

      },{
          path : '/functionthree',
          component: functionthree

      },{
          path : '/shangchuan',
          component: shangchuan

      },{
          path : '/commentone',
          component: commentone

      }
  ]
})



// 路由器会创建一个 App 实例，并且挂载到选择符 #app 匹配的元素上。
const app = new Vue({
    router: router,
    store,
    render: h => h(App)
}).$mount('#app')


router.afterEach(function(to){
    window.scrollTo(0,0)

});